# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=tracker-miners
pkgver=2.3.5+2+gec09554af
pkgrel=3
pkgdesc="Collection of data extractors for Tracker/Nepomuk"
url="https://wiki.gnome.org/Projects/Tracker"
arch=(x86_64)
license=(GPL)
depends=(tracker gst-plugins-base-libs exempi flac libexif libcue libgrss libgsf
         libgxps libiptcdata libosinfo libvorbis poppler-glib totem-plparser
         giflib libgexiv2 gupnp-dlna upower libseccomp)
makedepends=(intltool git meson vala)
checkdepends=(python-gobject gst-plugins-good gst-plugins-base gst-libav)
groups=(gnome)
_commit=ec09554afbcf6d6864add8331e977f9d5028f5ce  # tracker-miners-2.3
source=("git+https://gitlab.gnome.org/GNOME/tracker-miners.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd tracker-miners
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd tracker-miners
}

build() {
  arch-meson tracker-miners build
  meson compile -C build
}

check() {
  # Intermittent test failures: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/79
  dbus-run-session meson test -C build --print-errorlogs -t 3 || :
}

package() {
  depends+=(libtracker-{miner,sparql}-2.0.so)

  meson install -C build --destdir "$pkgdir"
}
